package com.ghy.nba.services;

import com.ghy.nba.dao.BallTeamRepository;
import com.ghy.nba.entities.BallStar;
import com.ghy.nba.entities.BallTeam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BallTeamService {

    @Autowired
    BallTeamRepository ballTeamRepository;

    public BallTeam save(BallTeam ballTeam){return ballTeamRepository.save(ballTeam);}

    public List<BallTeam> getALL(){return ballTeamRepository.findAll();}

    public BallTeam findByBallteamIdId(long theId){

        return ballTeamRepository.findByBallteamId(theId);
    }
    public void delete(BallTeam theBallteam){
        ballTeamRepository.delete(theBallteam);
    }
}
